package com.a0soft.gphone.aTruffleHog;
/*
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation; either version 3, or (at your option) any
 * later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * Copyright(C) 2011 
 *   Sam Lu <ysl.sam.lu (at) gmail.com>
 *
 */

import com.a0soft.gphone.aTruffleHog.util.CONFIGURATION;
import com.a0soft.gphone.aTruffleHog.util.CrashHandler;
import com.a0soft.gphone.aTruffleHog.util.MiscUtil;
import com.a0soft.gphone.aTruffleHog.util.aDebug;

import android.app.Application;
import android.content.Context;

public class MainApp extends Application {
	private static MainApp	m_inst;
	
	private static final String LOG_TAG = MainApp.class.getSimpleName();

	////////////////////////////////////////
    public static MainApp
    GetInstance()
    {
    	return m_inst;
    }
    
    public 
    MainApp()
    {
        m_inst = this;
    }

	@Override public void 
	onCreate()
    {
	    if (aDebug.ENABLED)
	    	aDebug.d(LOG_TAG, "_OnCreate()");
        
	    super.onCreate();
	    
	    Context ctx = this.getApplicationContext();
	    
	    MiscUtil.Init(ctx);
	    CrashHandler.Init(ctx, CONFIGURATION.PROJECT_OWNER_EMAIL, true);
    }
}
